package com.emeraldparser.util;

import java.util.Collection;

import com.google.common.collect.ForwardingCollection;

/**
 * A {@link ForwardingCollection} whose "bulk" modifying methods (
 * {@link Collection#addAll(Collection)},
 * {@link Collection#retainAll(Collection)},
 * {@link Collection#removeAll(Collection)} and {@link Collection#clear()}
 * 
 * ) delegate to their "standard" counterpart methods (for example,
 * {@link Collection#removeAll(Collection)} calls
 * {@link ForwardingCollection#standardRemoveAll(Collection)}. Methods without a
 * "standard" counterpart are not overridden.
 * 
 * @author Adam Paynter
 */
public abstract class StandardBulkModificationForwardingCollection<E> extends ForwardingCollection<E> {

	@Override
	public boolean addAll(Collection<? extends E> collection) {
		return standardAddAll(collection);
	}

	@Override
	public boolean retainAll(Collection<?> collection) {
		return standardRetainAll(collection);
	}

	@Override
	public boolean removeAll(Collection<?> collection) {
		return standardRemoveAll(collection);
	}

	@Override
	public void clear() {
		standardClear();
	}

}
